@import '~react-code-view/styles/react-code-view.css';

.rcv-highlight {
  position: relative;
  background-color: @doc-highlight-bg;
  padding: 10px;
  margin: 1em 0;
  border-radius: 6px;
  pre {
    margin: 0;
  }
  code,
  .hljs-title {
    padding: 0 !important;
    margin: 0 !important;
  }

  .rs-theme-dark &,
  .rs-theme-high-contrast & {
    background-color: @doc-highlight-bg;
  }
}

code:not(.rcv-highlight) {
  border-radius: 2px;
  font-size: 0.8rem;
  margin: 0 2px;
  padding: 3px 5px;
  white-space: pre-wrap;
  font-family: Roboto Mono, Monaco, courier, monospace;

  color: rgb(236, 80, 96);
}

code.bash {
  background-color: @doc-highlight-bg;
  color: #eee;
}

a code {
  background: none !important;
}

.rcv-render .rs-btn-toolbar + .rs-btn-toolbar {
  margin-top: 10px;
}

.rcv-render .rs-toggle {
  margin-right: 8px;
  .rs-icon {
    width: 14px;
    text-align: center;
  }
}

.rcv-render > div > .tree-view {
  border: 1px solid #eee;
}

.rcv-render .field p {
  line-height: 32px;
}

.rcv-container {
  transition: 0.3s linear border-color;
  margin: 18px 0;
  padding: 0;
  border-color: @code-view-wrapper-border-color;
  background-color: @code-view-wrapper-bg;
  border-radius: 6px;

  .CodeMirror {
    margin: 0;
    background-color: @doc-highlight-bg;
  }
  .CodeMirror-gutters {
    background-color: @doc-highlight-bg;
  }

  hr {
    border-top-color: var(--rs-border-primary);
  }

  .rcv-toolbar {
    padding: 8px;
    border-color: @code-view-wrapper-border-color;

    .rs-btn {
      font-size: 0;
      line-height: 16px;
      margin: 0 2px;

      .rs-icon {
        font-size: 16px;
      }
    }
  }
  .rcv-render-error {
    max-height: 200px;
  }

  .rcv-render {
    padding: 18px;
  }

  .rs-theme-dark &,
  .rs-theme-high-contrast & {
    border-color: #1a1d24;

    .rcv-toolbar {
      border-color: #1a1d24;
    }
  }
}

.rcv-render .rs-badge ~ .rs-badge {
  margin-left: 20px;
}

.rcv-render .notification-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.rcv-editor {
  border-radius: 0 0 6px 6px;
}

.copy-code-button {
  position: absolute;
  color: #858b94;
}

.rcv-editor .copy-code-button {
  right: 8px;
  top: 8px;
  z-index: 1;
}

.rcv-highlight .copy-code-button {
  right: 8px;
  top: 8px;
}
